package com.xbs.service.content;

import java.util.List;

import com.xbs.dao.content.OrderDao;
import com.xbs.entity.CarModelEntity;
import com.xbs.entity.CommonOrderEntity;
import com.xbs.entity.OrderMoney;
import com.xbs.entity.RentEntity;
import com.xbs.entity.TimeEntity;

public class OrderService {
	private OrderDao od;
	
	public OrderService() {
		od = new OrderDao();
	}
	
	/**
	 * 1.获取数据库中该车辆的配置信息
	 * @param name
	 * @return
	 */
	public CarModelEntity getCarModel(String name){
		CarModelEntity carmodel = od.getCarModel(name);
		return carmodel;
	}
	
	/**
	 * 2.生成普通订单表(上门取还)
	 * @param order
	 */
	public void insCommonOrder(CommonOrderEntity order){
		int row = od.insCommonOrder(order);
	}
	
	/**
	 * 3.生成实际租车人表
	 * @param rent
	 */
	public void insRent(RentEntity rent){
		int row = od.insRent(rent);
	}
	
	/**
	 * 4.生成订单金额表(上门取送，无手续费)
	 * @param om
	 */
	public void insOrderMoney(OrderMoney om){
		int row = od.insOrderMoney(om);
	}
	
	/**
	 * 5.生成操作人时间表
	 * @param time
	 */
	public void insTime(TimeEntity time){
		int row = od.insTime(time);
	}
	
	/**
	 * 6.根据城市获取门店的编号
	 * @param city
	 * @return
	 */
	public String selStoreId(String city){
		return od.selStoreId(city);
	}
	
	/**
	 * 7.生成普通订单表(到店取还)
	 * @param order
	 */
	public void insCommonOrderStore(CommonOrderEntity order){
		int row = od.insCommonOrderStore(order);
	}
	
	/**
	 * 8.当异店还车时，获取手续费
	 * @param fromnum
	 * @param tonum
	 * @return
	 */
	public Double selServiceMoney(int fromnum,int tonum){
		return od.selServiceMoney(fromnum, tonum);
	}
	
	/**
	 * 9.生成订单金额表（到店取还，异店，有手续费）
	 * @param om
	 */
	public void insOrderMoneyService(OrderMoney om){
		int row = od.insOrderMoneyService(om);
	}
	
	/**
	 * 10.根据车型编号在车表中查车类型（豪华型等）
	 * @param id
	 * @return
	 */
	public String selCarType(String id){
		return od.selCarType(id);
	}
}
